package com.aaa.framework.redis;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

/**
 * @author HeXinxiang
 * @title: RedisService
 * @projectName onenoc
 * @description:
 * @date 2024-06-27 17:06
 */
public interface RedisServiceInterface {
    public <T> void setCacheObject(final String key, final T value);

    public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit);

    public boolean expire(final String key, final long timeout);

    public Boolean expire(final String key, final long timeout, final TimeUnit unit);

    public Boolean expireRightNow(final String key);

    public Long getExpire(final String key);

    public Boolean hasKey(String key);

    public <T> T getCacheObject(final String key);

    public Boolean deleteObject(final String key);

    public Long deleteObject(final Collection collection);

    public <T> long setCacheList(final String key, final List<T> dataList);

    public <T> List<T> getCacheList(final String key);

    public <T> long setCacheSet(final String key, final Set<T> dataSet);

    public <T> Set<T> getCacheSet(final String key);

    public <T> void setCacheMap(final String key, final Map<String, T> dataMap);

    public <T> Map<String, T> getCacheMap(final String key);

    public <T> void setCacheMapValue(final String key, final String hKey, final T value);

    public <T> T getCacheMapValue(final String key, final String hKey);

    public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys);

    public boolean deleteCacheMapValue(final String key, final String hKey);

    public Collection<String> keys(final String pattern);
}
